const express = require('express')
const router = express.Router()
const routeName = 'profiles'
// 获取用户资料
router.get(`/${routeName}/:id`, async (req, res, next) => {
  try {
    // 处理请求
    res.send('get-/users/' + req.params.id)
  } catch (err) {
    next(err)
  } 
})
// 关注用户
router.post(`/${routeName}/:id/follow`, async (req, res, next) => {
    try {
      // 处理请求
      res.send('POST-/users/' + req.params.id + 'follow')
    } catch (err) {
      next(err)
    } 
})
// 取消关注用户
router.delete(`/${routeName}/:id/follow`, async (req, res, next) => {
    try {
      // 处理请求
      res.send('delete-/users/' + req.params.id + 'follow')
    } catch (err) {
      next(err)
    } 
})
module.exports = router